/*
@    Author : Rich of BeastModeMS
@
@    NPC = Mr. Oh
@    Map =  MAP
@    NPC MapId = MAPID
@    Function = All in one Shop
@
*/

var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendSimple ("Hello, #eI'm back from a long vacation#n\r\nDo you want to buy some items?#d" +
				"#k\r\n#L80##rMagician Equips" +
				"#k\r\n#L81##rTheif Equips" +
				"#k\r\n#L82##rWarrior Equips" +
                 		"#k\r\n#L83##rArcher Equips" +
				"#k\r\n#L84##rPirate Equips" +
				"#k\r\n#L65##rScrolls");
		} else if (status == 1) {
			if (selection == 80) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L0##rMagican Shoes" +
					"#k\r\n#L1##rMagican Overalls" +
					"#k\r\n#L2##rMagican Gloves" +
					"#k\r\n#L3##rMagican Hats" +
					"#k\r\n#L4##rMagican Shields" +
					"#k\r\n#L5##rMagican and Common Wands" +
					"#k\r\n#L6##rMagican and Common Staffs");
			} else if (selection == 81) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L7##bThief Shoes" +
					"#k\r\n#L8##bThief Bottoms" +
					"#k\r\n#L9##bThief Tops" +
					"#k\r\n#L10##bThief Overalls" +
					"#l\r\n#L11##bThief Gloves" +
					"#l\r\n#L12##bThief Hats" +
					"#l\r\n#L13##bThief Shields" +
					"#l\r\n#L14##bThief and Common Daggers" +
					"#k\r\n#L15##bThief and Common Claws" +
					"#k\r\n#L16##bThief Throwing Stars");
			} else if (selection == 82) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L17##dWarrior Shoes" +
					"#k\r\n#L18##dWarrior Bottom" +
					"#k\r\n#L19##dWarrior Top" +
					"#k\r\n#L20##dWarrior Overalls" +
					"#k\r\n#L21##dWarrior Gloves" +
					"#k\r\n#L22##dWarrior Hats" +
					"#k\r\n#L23##dWarrior Shields" +
					"#k\r\n#L24##dWarrior and Common One-Handed Axes" +
					"#k\r\n#L25##dWarrior and Common Two-Handed Axes" +
					"#k\r\n#L26##dWarrior and Common One-Handed BWs" +
					"#k\r\n#L27##dWarrior and Common Two-Handed BWs" +
					"#k\r\n#L28##dWarrior and Common One-Handed Swords" +
					"#k\r\n#L29##dWarrior and Common Two-Handed Swords" +
					"#k\r\n#L30##dWarrior and Common Spears" +
					"#k\r\n#L31##dWarrior and Common Pole Arms");
			} else if (selection == 83) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L32##gArcher Shoes" +
					"#k\r\n#L33##gArcher Overalls" +
					"#k\r\n#L34##gArcher Gloves" +
					"#k\r\n#L35##gArcher Hats" +
					"#k\r\n#L36##gArcher and Common Bows" +
					"#k\r\n#L37##gArcher and Common Crossbows" +
					"#k\r\n#L38##gArcher Arrows");
			} else if (selection == 84) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L64##bPirate Hats" +
					"#k\r\n#L59##bPirate Weapons" +
					"#k\r\n#L60##bPirate Bullets and Capsules" +
					"#k\r\n#L61##bPirate Overalls" +
					"#k\r\n#L62##bPirate Gloves" +
					"#k\r\n#L63##bPirate Shoes");
			} else if (selection == 85) {
				cm.sendSimple ("Pick a Category #d" +
					"#k\r\n#L39#Maple Weapons" +
					"\r\n#L40#Earrings" +
					"\r\n#L41#Necklaces and Face Accessories" +
					"\r\n#L42#Capes" +
					"\r\n#L43#Common Shoes" +
					"\r\n#L44#Common Hats" +
					"\r\n#L45#Common Gloves" +
					"\r\n#L46#Common Overalls" +
					"\r\n#L47#Common Shields" +
					"\r\n#L48#Level 0 Weapons");
			} else if (selection == 0) {
				cm.openShop (10000);
			} else if (selection == 1) {
				cm.openShop (10001);
			} else if (selection == 2) {
				cm.openShop (10002);
			} else if (selection == 3) {
				cm.openShop (10003);
			} else if (selection == 4) {
				cm.openShop (10004);
			} else if (selection == 5) {
				cm.openShop (10005);
			} else if (selection == 6) {
				cm.openShop (10006);
			} else if (selection == 7) {
				cm.openShop (10007);
			} else if (selection == 8) {
				cm.openShop (10008);
			} else if (selection == 9) {
				cm.openShop (10009);
			} else if (selection == 10) {
				cm.openShop (10010);
			} else if (selection == 11) {
				cm.openShop (10011);
			} else if (selection == 12) {
				cm.openShop (10012);
			} else if (selection == 13) {
				cm.openShop (10013);
			} else if (selection == 14) {
				cm.openShop (10014);
			} else if (selection == 15) {
				cm.openShop (10015);
			} else if (selection == 16) {
				cm.openShop (10038);
			} else if (selection == 17) {
				cm.openShop (10016);
			} else if (selection == 18) {
				cm.openShop (10017);
			} else if (selection == 19) {
				cm.openShop (10018);
			} else if (selection == 20) {
				cm.openShop (10019);
			} else if (selection == 21) {
				cm.openShop (10020);
			} else if (selection == 22) {
				cm.openShop (10021);
			} else if (selection == 23) {
				cm.openShop (10022);
			} else if (selection == 24) {
			cm.openShop (10023);
			} else if (selection == 25) {
				cm.openShop (10024);
			} else if (selection == 26) {
				cm.openShop (10025);
			} else if (selection == 27) {
				cm.openShop (10026);
			} else if (selection == 28) {
				cm.openShop (10027);
			} else if (selection == 29) {
				cm.openShop (10028);
			} else if (selection == 30) {
				cm.openShop (10029);
			} else if (selection == 31) {
				cm.openShop (10030);
			} else if (selection == 32) {
				cm.openShop (10031);
			} else if (selection == 33) {
				cm.openShop (10032);
			} else if (selection == 34) {
				cm.openShop (10033);
			} else if (selection == 35) {
				cm.openShop (10034);
			} else if (selection == 36) {
				cm.openShop (10035);
			} else if (selection == 37) {
				cm.openShop (100320);
			} else if (selection == 38) {
				cm.openShop (10037);
			} else if (selection == 39) {
				cm.openShop (10051);
			} else if (selection == 40) {
				cm.openShop (10039);
			} else if (selection == 41) {
				cm.openShop (10040);
			} else if (selection == 42) {
				cm.openShop (10041);
			} else if (selection == 43) {
				cm.openShop (10042);
			} else if (selection == 44) {
				cm.openShop (10043);
			} else if (selection == 45) {
				cm.openShop (10044);
			} else if (selection == 46) {
				cm.openShop (10045);
			} else if (selection == 47) {
				cm.openShop (10046);
			} else if (selection == 48) {
				cm.openShop (10047);
			} else if (selection == 49) {
				cm.openShop (10048);
			} else if (selection == 50) {
				cm.openShop (10048);
			} else if (selection == 51) {
				cm.openShop (10049);
			} else if (selection == 52) {
				cm.openShop (10050);
			} else if (selection == 53) {
				cm.openShop (10052);
			} else if (selection == 54) {
				cm.openShop (10053);
			} else if (selection == 55) {
				cm.openShop (10054);
			} else if (selection == 56) {
				cm.openShop (10055);
			} else if (selection == 57) {
				cm.openShop (10056);
			} else if (selection == 58) {
				cm.openShop (10057);
			} else if (selection == 59) {
				cm.openShop (13035);
			} else if (selection == 60) {
				cm.openShop (13001);
			} else if (selection == 61) {
				cm.openShop (13002);
			} else if (selection == 62) {
				cm.openShop (13003);
			} else if (selection == 63) {
				cm.openShop (13004);
			} else if (selection == 64) {
				cm.openShop (13005);
			} else if (selection == 65) {
				cm.openShop (10053);
			}
			if (selection < 80)
				cm.dispose();
		}
	}
}